package com.example.demo.controller;

import com.example.demo.dto.Student;
import com.sun.media.jfxmedia.logging.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

@RestController
public class HelloController {
    private final org.slf4j.Logger logger = LoggerFactory.getLogger(this.getClass());
    /**
     * @api {delete} /wallet/delete
     * @apiVersion 0.1.1
     * @apiName 删除用户的钱包
     * @apiGroup wallet
     * @apiDescription 删除钱包的接口
     * @apiParam {String} username 用户名
     * @apiParam {String} passcode 密码
     * @apiParam {String} org 用户组织
     * @apiParamExample {json}
     * Request-Example 1:
     * {
     *      "username":"DDD",
     *      "passcode":"qweqwe123",
     *      "org":"oxhainan"
     * }
     * @apiSuccessExample Success-Response:
     * {
     *     "Status":"200"
     * }
     */
    @RequestMapping(value = "/sayHello",method = RequestMethod.GET)
    public String sayHello(@RequestParam("name") String name){
        //org.slf4j.Logger log = LoggerFactory().getLogger(this.getClass());
        logger.info(name);
       System.out.println(name);
        return "hello,Jekinsasdasdasdassd22123123!!  猪猪_"+name;
    }
    @GetMapping("/get/test")
    public String requestGet(Integer age){
        return "age:" + age;
    }
    @GetMapping("/get/object/test")
    public String requestobjectGet(Student student){
        return "name:" + student.getName()+",age:"+student.getAge();

        //http://localhost:8080/get/object/test?name=tom&age=18
    }
}
